package com.deruan.hotcore.resource.table;

import java.util.List;
import java.util.Observable;

import javax.swing.ListSelectionModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import javax.swing.tree.TreePath;

import org.columba.mail.folder.IMailFolder;
import org.columba.mail.gui.table.IMessageNode;

import com.deruan.hotcore.base.common.bean.ResourceBean;
import com.deruan.hotcore.resource.gui.tree.ResourceTreeNode;
import com.deruan.hotcore.resource.table.model.IResourceHeaderTableModel;

public interface IResourceTableController 
{
	void showResourceList(IMailFolder folder, List<ResourceBean> headerList) throws Exception ;
	/**
	 * Get view of table controller
	 * 
	 * @return table view
	 */
	//TableView getView();

	/**
	 * Get table model
	 * 
	 * @return table model
	 */
	IResourceHeaderTableModel getHeaderTableModel();

	/**
	 * Show the headerlist of currently selected folder.
	 * <p>
	 * Additionally, implements folderoptions plugin entrypoint.
	 * 
	 * @see org.columba.mail.folder.folderoptions
	 * @see org.columba.mail.gui.frame.ViewHeaderListInterface#showHeaderList(org.columba.mail.folder.Folder,
	 *      org.columba.mail.message.HeaderList)
	 */
	IMessageNode[] getSelectedNodes();
	void setSelected(Object[] uids);
	int[] getSelectedRows();
	TreePath getPathForRow(int row);
	
	int getRowCount();
	
	Object selectFirstRow();
	Object selectLastRow();
	void selectRow(int row);
	void clearSelection();
	void makeSelectedRowVisible();
	
	ResourceTreeNode getMessageNode(Object uid);

	Observable getSortingStateObservable();
	void setSortingOrder(boolean order);
	void setSortingColumn(String column);	
	String getSortingColumn();
	boolean getSortingOrder();
	
	void clear();
	
	TableColumnModel getColumnModel();
	void resetColumnModel();
	TableColumn createTableColumn(String  name, int size);
	void addColumn(TableColumn column);
	ListSelectionModel getListSelectionModel();
}
